/**
 * extends
 */


class Person {
    static create(name) {
        return new Person(name)
    }
    constructor(name) {
        this.name = name
    }
    say() {
        console.log(`hi,my name is ${this.name}`)
    }
}

class Student extends Person {
    constructor(name, number) {
        super(name)  //super表示继承的类的方法获属性
        this.number = number
    }
    hello() {
        super.say()
        console.log(`我的学号是${this.number}`)
    }
}
// let p = new Person('tom')
// p.say()

let p = Person.create('tom')
console.log(p)

let s = new Student('jack', 111)
s.hello()